<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="配置项名称">
              <j-input placeholder="请输入配置项名称" v-model="queryParam.type"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="描述信息">
              <j-input placeholder="请输入描述信息" v-model="queryParam.remark"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
    </div>

    <!-- table区域-begin -->
    <div>

      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-wrap"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

        <!--  <a-divider type="vertical"/>
            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
            </a-popconfirm>-->
        </span>

      </a-table>
    </div>

    <cms-config-modal ref="modalForm" @ok="modalFormOk"></cms-config-modal>
  </a-card>
</template>

<script>
  import {putAction} from "@/api/manage";
  import '@/assets/less/TableExpand.less'
  import {mixinDevice} from '@/utils/mixin'
  import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  import CmsConfigModal from './modules/CmsConfigModal'
  import JInput from '@/components/jeecg/JInput';

  export default {
    name: 'CmsConfigList',
    mixins: [JeecgListMixin, mixinDevice],
    components: {
      CmsConfigModal, JInput
    },
    data() {
      return {
        description: '一对一字典管理页面',
        // 表头
        columns: [
          {
            title: '#',
            align: "center",
            width: 60,
            customRender: function (t, r, i) {
              return i + 1;
            }
          },
          {
            title: '配置项名称',
            align: "center",
            dataIndex: 'type'
          },
          {
            title: '配置项内容',
            align: "center",
            width: 400,
            dataIndex: 'params'
          },
          {
            title: '作用描述',
            align: "center",
            dataIndex: 'remark'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align: "center",
            fixed: "right",
            width: 147,
            scopedSlots: {customRender: 'action'}
          }
        ],
        url: {
          list: "/cms/config/list",
          delete: "/cms/config/delete",
        },
        isorter: {
          column: '',
          order: '',
        },
        dictOptions: {},
      }
    },
    methods: {
      initDictConfig() {
      }
    }
  }
</script>
<style scoped>
</style>